package com.yc.navy.goods.runner;

import java.io.File;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.yc.navy.goods.util.ConstantInfo;


@Component
public class CreateUploadPathRunner implements CommandLineRunner{
	@Value("${web.upload-path}")
	private String basepath;

	@Override
	public void run(String... args) throws Exception {
		File fl = new File(basepath, ConstantInfo.UPLOADPATH);
		if(!fl.exists()) {
			fl.mkdirs();
		}
		ConstantInfo.basepath = basepath;
	}
	
}
